﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Geometry
{
    public struct Rect
    {
        public double X;
        public double Y;
        public double Width;
        public double Height;

        public Rect(Point p1, Point p2)
        {
            X = Math.Min(p1.X, p2.X);
            Y = Math.Min(p1.Y, p2.Y);
            Width = Math.Max(p1.X, p2.X) - X;
            Height = Math.Max(p1.Y, p2.Y) - Y; 
        }
    }
}
